#include "HashTable.h"

    

namespace Hash{
    template <class Key,class MyHashfunc = DefaultHashfunc<Key>>
    class set{
        struct GetSetKey
        {
            const Key& operator ()(const Key& data)
            {
                return data;
            }
        };
        public:
        typedef  HashTableBuket<Key,Key,GetSetKey,MyHashfunc> SetHash;
        typedef typename SetHash::const_iterator iterator; 
        typedef typename SetHash::const_iterator const_iterator; 
        SetHash SetM_HashTable;
        pair<iterator,bool> insert(const Key& k)
        {
            auto tmp = SetM_HashTable.insert(k);
            return make_pair(iterator(tmp.first.first,&SetM_HashTable,tmp.second),tmp.first.second);
        }
        iterator begin()const
        {
            return SetM_HashTable.cbegin();
        }
        iterator end()const
        {
            return SetM_HashTable.cend();
        }
        const_iterator cbegin()const
        {
            return SetM_HashTable.cbegin();
        }
        const_iterator cend()const
        {
            return SetM_HashTable.cend();
        }
        bool erase(const Key&k)
        {
            return SetM_HashTable.erase(k);
        }
        Key find(const Key& k)
        {
            return SetM_HashTable.find(k)->n_data;
        }
    };
};

